<template>
	<view>
		<uni-search-bar class="flex1" bgColor="#fff" radius="10" placeholder="请输入用户ID查询" v-model="keywords" @clear="clear" @confirm="submit" cancelButton="none"></uni-search-bar>
		<view class="re_list">
			<view class="re_item" v-for="item in list">
				<view class="re_head">服务人：{{item.operator_name}}</view>
				<view class="re_head">被服务：{{item.nickname}}</view>
				<view class="re_head">区域：{{item.all_address_name}}</view>
				<view class="re_head">缴纳金额：{{item.money}}</view>
				<view class="flex_between" style="align-items: flex-start;">
					<view class="re_flex_item">
						<view>
							<text>区域公司：</text>
							<text class="re_num">{{item.region_money}}</text>
						</view>
						<!-- <view>
							<text>大区公司：</text>
							<text class="re_num">{{item.upper_region_money}}</text>
						</view> -->
						<view>
							<text>管理津贴：</text>
							<text class="re_num">{{item.manage_money}}</text>
						</view>
						<view v-if="item.stock_percent!=''">
							<text>股权：</text>
							<text class="re_num">{{item.stock_percent}}%</text>
						</view>
					</view>
					<view class="re_flex_item">
						<view>
							<text>推荐人佣金：</text>
							<text class="re_num">{{item.agent_money}}</text>
						</view>
						<view>
							<text>待补贴金额：</text>
							<text class="re_num">{{item.md_money}}</text>
						</view>
					</view>
				</view>
				<view class="re_head" v-if="item.real_name!=''">股东：{{item.real_name}}</view>
				<view class="re_head" v-if="item.id_card_number!=''">身份证号：{{item.id_card_number}}</view>
				<view class="re_head">缴纳金额：{{item.money}}</view>
				<view class="re_num">服务时间：{{item.created_time}}</view>
			</view>
			<view class="empty_loading">
				<image v-if="isloading" src="/static/business/loading.gif"></image>
				<view v-if="ismore">到底了~</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				keywords: '',
				page: 0,
				list: [],
				isloading: false,
				ismore: false,
			};
		},
		onLoad(){
			this.getList();
		},
		onReachBottom() {
			this.getList();
		},
		methods: {
			clear(){
				this.keywords = '';
				this.page = 0;
				this.list = [];
				this.getList()
			},
			submit(){
				this.page = 0;
				this.list = [];
				this.getList()
			},
			getList(){
				this.page++;
				this.isloading = true;
				this.$axios('RegionalService/lists','POST','regional',{
					page: this.page,
					memberId: this.keywords
				}).then(res=>{
					this.isloading = false;
					if(res.data.code == 200){
						this.list = [...this.list,...res.data.data.list];
						this.ismore = res.data.data.list.length<=0;
					}
				})
			}
		}
	}
</script>

<style lang="scss">
page{
	background: #FBF8FE;
	padding-bottom: 120rpx;
}
.re_list{
	padding: 20rpx;
	.re_item{
		border: 2rpx solid #e6e5e5;
		margin-bottom: 20rpx;
		border-radius: 14rpx;
		padding: 20rpx;
		line-height: 50rpx;
		.re_flex_item{
			width: 50%;
		}
		.re_head{
			font-weight: bold;
		}
		.re_num{
			color: #666;
		}
	}
}
</style>
